package com.atbeijing.bigdata.spark.core.acc;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {

        List<String> words = new ArrayList<>();
        words.add("Hello");
        words.add("Hello");
        words.add("Hello");
        words.add("World");
        words.add("Hello");
        words.add("Hello");

        WordCountAnalysis wca1 = new WordCountAnalysis();
        WordCountAnalysis wca2 = new WordCountAnalysis();
        WordCountAnalysis wca3 = new WordCountAnalysis();

        for ( int i = 0; i < 2; i++ ) {
            String word = words.get(i);
            wca1.add(word);
        }

        for ( int i = 2; i < 4; i++ ) {
            String word = words.get(i);
            wca2.add(word);
        }
        for ( int i = 4; i < 6; i++ ) {
            String word = words.get(i);
            wca3.add(word);
        }

        System.out.println(wca1.analysisSesult());
        System.out.println(wca2.analysisSesult());
        System.out.println(wca3.analysisSesult());

        wca1.merge(wca2).merge(wca3);




    }
}
